package org.fatmansoft.teach.service;
import org.fatmansoft.teach.models.Honour;
import org.fatmansoft.teach.models.Person;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;
@Service
public class HonourService {
    public Map getMapFromHonour(Honour h) {
        Map m = new HashMap();
        Person p;
        if(h == null){
            return m;
        }
        m.put("honourId",h.getHonourId());
        m.put("honourName",h.getHonourName());
        m.put("describe",h.getDescribe());
        p = h.getPerson();
        m.put("num",p.getNum());
        m.put("name",p.getName());
        return m;
    }
}